loadControl=function(options,html) {
   var view = {};
   var _this = html;
   view.version = "1.0";
   view._data = {
      conf:{
         data : "", 
         jid : "views",
         mid : "mainView", 
         status : "0", /*0:加载中;1:加载成功;2：加载失败*;3:没有更多,4:权限判断*/
         type : "0" /*0:刷新；1：插入*/ 
      },
      tpl:{
      	 /*图片列表*/
         images : [
                    '<div class="panel-comp" comptype="images" style="width: 100%;">',
                         '<div class="comp-group">',  
                          '<div class="comp-body">',
                             ' <div class="STH_images_panel STH_images_style_0">',
                                   '<div class="STH_images_box">',
                                    '<div class="STH_images STH_iDefault_0" rel="yuan"></div>',
                                    '<div class="STH_images STH_iDefault_0" rel="yuan"></div>',
                                                        '<div class="STH_images STH_iDefault_0" style="display: none;" rel="yuan"></div>',
                                                        '<div class="STH_images STH_iDefault_0" style="display: none;" rel="yuan"></div>',
                                                      ' <div class="STH_images STH_iDefault_0" style="display: none;" rel="yuan"></div>',
                                                       ' <div class="STH_images STH_iDefault_0" style="display: none;" rel="yuan"></div>',
                                   '</div>',
                                '</div>',
                              '</div>',
                        '</div>'
               ],
        /*满减*/
       favorable :[
                  '<div class="panel-comp" comptype="favorable" style="width: 100%;">',
                                '<div class="comp-group">', 
                                           ' <div class="comp-body">',
                                             '<ul class="STH_favorable_box">',
                                                  '<li> <span class="tips">减</span> <a href="{url}" class="fr">优惠买单</a><span class="f14">手机买单享优惠</span> </li>',
                                              '</ul>',
                                            '</div>',
                                '</div>',
                  '</div>'
               ],
        /*优惠券*/ 
        coupon : [
                   '<div class="panel-comp" comptype="coupon" style="width: 100%;">',
                                       ' <div class="comp-group">',  
                                           ' <div class="comp-body">',
                                               ' <div class="STH_shop_coupon">',
                                                   ' <div class="store-card">',
                                                        '<div class="store-card-list" rel="yuan">',
                                                           ' <div class="store-card-list-box">',
                                                                '<a href="{{url}}" >',
                                                                 '   <div class="store-card-title"><span>已领完</span></div>', 
                                                                  '  <div class="store-card-list-left">',
                                                                   '     <div class="bor-right"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div>',
                                                                    '    <span>0<em>元</em></span>',
                                                                    '    <p>满0元使用</p>',
                                                                   ' </div>',
                                                                    '<div class="store-card-list-right">',
                                                                       ' 优<br>',
                                                                       ' 惠<br>',
                                                                      '  券',
                                                                  '  </div>',
                                                                '</a>',
                                                           ' </div>',
                                                        '</div>',
                                                   ' </div>',
                                               ' </div>',
                                           ' </div>',
                                          '  <script type="text/template" class="moban">',
                                              '  <div class="store-card-list">',
                                               '     <div class="store-card-list-box {p_style}">',
                                                    '    <a href="javascript:void(0)" coupon_id="{coupon_id}">',
                                                         '   <div class="store-card-title"><span>已领完</span></div>', 
                                                        '    <div class="store-card-list-left">',
                                                            '    <div class="bor-right"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div>',
                                                              '  <span>{money_exempt}<em>元</em></span>',
                                                             '   <p>{money_using_msg}</p>',
                                                           ' </div>',
                                                          '  <div class="store-card-list-right">优<br />惠<br />券</div>',
                                                      '  </a>',
                                                  '  </div>',
                                              '  </div>',
                                         '   </script>',
                                       ' </div>',
                                  '  </div>'
               ],
         text : [
                       '<div class="panel-comp" comptype="text" style="width: 100%;">',
                                '        <div class="comp-group">',  
                                           ' <div class="comp-body">',
                                                '<div class="comp-text textareas">',
                                                '</div>',
                                            '</div>',
                                       ' </div>',
                                    '</div>'
               ],
          /*导航*/
      	  navs : [
                    '<div class="panel-comp" comptype="navs" style="width: 100%;">',
                                       ' <div class="comp-group">', 
                                            '<div class="comp-body">',
                                            '    <div class="STH_navs_panel">',
                                             '       <ul class="navlist style1 icon_top clearfix">',
                                                   '   </ul> ',
                                                '</div>',
                                            '</div>',
                                        '</div>',
                                   ' </div>'
               ],
        swiper : [
        	/*轮播图*/
            ' <div class="panel-comp" comptype="swiper" style="width: 100%;">',
                                      '  <div class="comp-group">', 
                                          '  <div class="comp-body">',
                                             '   <div class="swiper-container STH_swiper_box">',
                                             '       <div class="swiper-wrapper">',
                                             '           <div class="swiper-slide" tindex="0"> ',
                                             '<a href="#"><img src="../css/shop/images/swiper-img.jpg"></a> </div>',
                                               '     </div>',
                                               '     <script type="text/template" id="imagesmb">',
                                              '          <div class="swiper-slide" tindex="{tIndex}">',
                                              '              <a href="{url}" tindex="{tIndex}"><img src="{urldata}"></a>',
                                              '          </div>',
                                              '      </script>',
                                               '     <div class="swiper-pagination"> <span class="swiper-pagination-switch"></span> </div>',
                                               ' </div>',
                                           '</div>',
                                      '  </div>',
                                  '  </div>'
          ],
         goods : [
             '   <div class="panel-comp" comptype="goods" style="width: 100%;">',
                                  '      <div class="comp-group">', 
                             '               <div class="comp-body">',
                             '                  <div class="comp-body-goods">',
                              '                      <div class="goods-list style-small">',
                              '                          <h3 style="display: none;">',
                               '                             <a class="clearfix">',
                              '                                  <h4>商品列表</h4>',
                              '                                  <span class="c333">更多<span class="c999">&gt;</span></span>',
                                '                            </a>',
                               '                         </h3>',
                               '                         <ul class="clearfix">',
                                '                            <li rel="yuan">',
                                '                                <div class="goods-inner">',
                                 '                                   <a href="">',
                                '                                        <div class="goods-img"> <img src="../css/shop/images/pro_default_img.png" alt="第1个商品"> </div>',
                                '                                        <div class="goods-title c333">第1个商品</div>',
                               '                                         <div class="goods_tag">',
                                 '                                           <div class="is_preferential">惠</div>',
                                 '                                           <div class="is_vip">折</div>',
                                  '                                      </div>',
                                    '                                    <div class="goods-info"> <span class="goods-price" yuandata="￥价格"><i>￥</i>价格</span> <span class="goods-del"><del>￥市场价</del></span> <span class="goods-sale">已售:数量</span> <span class="goods-stock">库存:数量</span> </div>',
                                 '                                   </a>',
                                 '                               </div>',
                                 '                           </li>',
                                 '                           <li rel="yuan">',
                                  '                              <div class="goods-inner">',
                                    '                                <a href="">',
                                '                                        <div class="goods-img"> <img src="../css/shop/images/pro_default_img.png" alt="第2个商品"> </div>',
                                  '                                      <div class="goods-title c333">第2个商品</div>',
                                  '                                      <div class="goods_tag">',
                                  '                                          <div class="is_preferential">惠</div>',
                                 '                                           <div class="is_vip">折</div>',
                                  '                                      </div>',
                                 '                                       <div class="goods-info"> <span class="goods-price" yuandata="￥价格"><i>￥</i>价格</span> <span class="goods-del"><del>￥市场价</del></span> <span class="goods-sale">已售:数量</span> <span class="goods-stock">库存:数量</span> </div>',
                                  '                                  </a>',
                                  '                              </div>',
                                 '                           </li>',
                                  '                      </ul> ',
                                   '                 </div>',
                                   '             </div>',
                                  '          </div>',
                                  '      </div>',
                                  '  </div>'
              
               ],
         dishes : [  
                   '<div class="panel-comp" comptype="dishes" style="width: 100%;">',
                                    '<div class="comp-group">', 
                                          '  <div class="comp-body">',
                                            '    <div class="comp-body-goods">',
                                           '         <div class="goods-list style-small">',
                                           '             <h3 style="display: none;">',
                                           '                 <a class="clearfix">',
                                           '                     <h4>菜品列表</h4>',
                                            '                    <span class="c333">更多<span class="c999">&gt;</span></span>',
                                            '                </a>',
                                           '             </h3>',
                                             '           <ul class="clearfix">',
                                            '                <li rel="yuan">',
                                             '                   <div class="goods-inner">',
                                             '                       <a href="">',
                                             '                           <div class="goods-img"> <img src="../css/shop/images/dishes_default_img.png" alt="第1个菜品"> </div>',
                                             '                           <div class="goods-title c333">第1个菜品</div>',
                                            '                            <div class="goods_tag">',
                                            '                                <div class="is_preferential">惠</div>',
                                             '                               <div class="is_vip">折</div>',
                                             '                           </div>',
                                            '                            <div class="goods-info"> <span class="goods-price" yuandata="￥价格"><i>￥</i>价格</span> <span class="goods-del"><del>￥市场价</del></span> <span class="goods-sale">已售:数量</span> <span class="goods-stock">库存:数量</span> </div>',
                                             '                       </a>',
                                             '                   </div>',
                                            '                </li>',
                                             '               <li rel="yuan">',
                                              '                  <div class="goods-inner">',
                                             '                       <a href="">',
                                             '                           <div class="goods-img"> <img src="../css/shop/images/dishes_default_img.png" alt="第2个菜品"> </div>',
                                             '                           <div class="goods-title c333">第2个菜品</div>',
                                              '                          <div class="goods_tag">',
                                             '                               <div class="is_preferential">惠</div>',
                                              '                              <div class="is_vip">折</div>',
                                               '                         </div>',
                                              '                          <div class="goods-info"> <span class="goods-price" yuandata="￥价格"><i>￥</i>价格</span> <span class="goods-del"><del>￥市场价</del></span> <span class="goods-sale">已售:数量</span> <span class="goods-stock">库存:数量</span> </div>',
                                              '                      </a>',
                                              '                  </div>',
                                              '              </li>',
                                              '          </ul> ',
                                              '      </div>',
                                              '  </div>',
                                           ' </div>',
                                        '</div>',
                                  '  </div>'
               ],
         notice:[
                     '  <div class="panel-comp" comptype="notice" style="width: 100%;">',
                        '                <div class="comp-group">', 
                         '                   <div class="comp-body">',
                         '                       <div class="notice-box">我就是公告啊！</div>',
                         '                   </div>',
                          '              </div>',
                          '          </div>'
               ],
         vedio:[ 
             '<div class="panel-comp" comptype="vedio" style="width: 100%;">',
                                       ' <div class="comp-group">', 
                                       '     <div class="comp-body">',
                                       '         <div class="STH_vedio_box">',
                                        '            <div>视频文件</div>',
                                       '             <iframe style="width: 100%; height: auto; display: none;" allowfullscreen="true" allowfullscreeninteractive="true" scrolling="no" src="" frameborder="0"></iframe>',
                                       '         </div>',
                                        '    </div>',
                                       ' </div>',
                                    '</div>'
               ],
          title:[     
               '<div class="panel-comp" comptype="title" style="width: 100%;">',
                                    '    <div class="comp-group">', 
                                    '        <div class="comp-body">',
                                    '            <div class="STH_title_box clearfix">',
                                    '                <a href="">',
                                    '                    <img class="STH_title_logo" src="{{shop_logo}}"> <span>{{title}}</span>',
                                    '                    <label></label>',
                                    '                    <i class="icon kxfont icon-gengduo"></i>',
                                    '                </a>',
                                    '            </div>',
                                    '        </div>',
                                     '   </div>',
                                  '  </div>'
                ],
            tell:[          
                '<div class="panel-comp" comptype="tell" style="width: 100%;" >',
                                     '   <div class="comp-group"  >', 
                                     '       <div class="comp-body" >',
                                     '           <div class="STH_tell_box clearfix">',
                                     '               <i class="icon kxfont icon-phone"></i> <span>客服电话</span>',
                                     '               <label></label>',
                                     '          </div>',
                                     '      </div>',
                                     '  </div>',
                                    '</div>'
                                    ],
            blank:['<div class="panel-comp" comptype="blank" style="width: 100%;">',
                                '        <div class="comp-group">', 
                                '            <div class="comp-body">',
                                '                <div class="blank-box">',
                                '                   <p class="blank-box-p"></p>',
                                '                </div>',
                                '            </div>',
                                '       </div>',
                                '    </div>'
                               ],
           comment:[
           				'<div class="panel-comp" comptype="comment" style="width: 100%;">',
                        '                <div class="comp-group">', 
                        '                    <div class="comp-body">',
                        '                        <div class="STH_comment_box">',
                       '                             <div class="STH_comment_title">',
                        '                                <a href="">更多</a>',
                        '                                <h2>用户评价</h2>',
                        '                            </div>',
                        '                            <div class="STH_comment_list">',
                        '                                <div class="comment_con" rel="yuan">',
                         '                                   <div class="person imgbox"> <img src="../css/shop/images/person.png"> </div>',
                        '                                    <div class="comment_talk">',
                        '                                        <p class="title"> <span class="name fl">用户姓名</span> <span class="time fr">日期</span> </p>',
                        '                                        <p class="star"> <span class="f24">打分</span> <span class="stars"></span> <span class="f28 num">0星</span> </p>',
                        '                                        <p class="word">用户评论</p>',
                        '                                        <ul class="comment_img_box">',

                        '                                        </ul>',
                        '                                    </div>',
                       '                                 </div>',
                        '                            </div>',
                       '                         </div>',
                        '                    </div>',
                        '                </div>',
                        '            </div>'],
           technician:[    
                    	' <div class="panel-comp" comptype="technician" style="width: 100%;">',
                        '                <div class="comp-group">', 
                        '                    <div class="comp-body">',
                        '                        <div class="comp-body-tech">',
                        '                            <div class="tech-list style-small">',
                        '                                <h3 style="display: none;">',
                        '                                   <a class="clearfix">',
                        '                                        <h4>服务人员列表</h4>',
                        '                                        <span class="c333">更多<span class="c999">&gt;</span></span>',
                        '                                    </a>',
                        '                                </h3>',
                        '                                <ul class="clearfix">',
                        '                                    <li rel="yuan">',
                        '                                        <div class="tech-inner">',
                       '                                             <a href="">',
                        '                                                <div class="tech-img"> <img src="{{url1}" alt="{第1个服务人员}"> </div>',
                        '                                                <div class="tech-title c333">第1个服务人员</div>',
                         '                                               <div class="tech-info">',
                        '                                                    <span class="tech-sale">已售:{num}数量</span>',
                        '                                                </div>',
                        '                                            </a>',
                        '                                        </div>',
                         '                                   </li>',
                        '                                    <li rel="yuan">',
                        '                                        <div class="tech-inner">',
                        '                                            <a href="{url}>',
                        '                                                <div class="tech-img"> <img src="{{url}}" alt="{{alt}}"> </div>',
                        '                                                <div class="tech-title c333">第2个服务人员</div>',
                     	'													  <span class="tech-sale">已售:{{num2}}数量</span>',
                        '                                                </div>',
                        '                                            </a>',
                        '                                        </div>',
                        '                                    </li>',
                        '                                </ul> ',
                        '                            </div>',
                        '                        </div>',
                        '                    </div>',
                        '                </div>',
                        '            </div>'],
          serviceItem:[ '<div class="panel-comp" comptype="serviceItem" style="width: 100%;">',
                        '                <div class="comp-group">', 
                        '                    <div class="comp-body">',
                        '                        <div class="comp-body-serviceItem">',
                            '                        <div class="serviceItem-list style-small">',
                         '                               <h3 style="display: none;">',
                         '                                   <a class="clearfix">',
                         '                                       <h4>服务人员列表</h4>',
                        '                                        <span class="c333">更多<span class="c999">&gt;</span></span>',
                          '                                  </a>',
                         '                               </h3>',
                         '                               <ul class="clearfix">',
                         '                                   <li rel="yuan">',
                          '                                     <div class="serviceItem-inner">',
                          '                                          <a>',
                           '                                             <div class="serviceItem-img"> <img src="../css/shop/images/serviceitem_default_img.png" alt="第1个服务"> </div>',
                          '                                              <div class="serviceItem-title c333">第1个服务</div>',
                          '                                              <div class="serviceItem-info"> <span class="serviceItem-price" yuandata="￥价格">￥价格</span> <span class="serviceItem-del"><del>￥市场价</del></span> <span class="serviceItem-sale">已售:数量</span> </div>',
                           '                                         </a>',
                           '                                     </div>',
                           '                                </li>',
                           '                                 <li rel="yuan">',
                           '                                     <div class="serviceItem-inner">',
                           '                                         <a>',
                           '                                             <div class="serviceItem-img"> <img src="../css/shop/images/serviceitem_default_img.png" alt="第2个服务"> </div>',
                           '                                             <div class="serviceItem-title c333">第2个服务</div>',
                           '                                             <div class="serviceItem-info"> <span class="serviceItem-price" yuandata="￥价格">￥价格</span> <span class="serviceItem-del"><del>￥市场价</del></span> <span class="serviceItem-sale">已售:数量</span> </div>',
                           '                                         </a>',
                           '                                     </div>',
                           '                                 </li>',
                           '                             </ul>',
                            '                        </div>',
                           '                     </div>',
                           '                 </div>',
                            '            </div>',
                           '         </div>']
      }
   };
   view._util = {};
   view._fun= {};
   
   (function(d,util){ 
      util.getHash = function() {
         return $.extend(d.conf, options);
      }
      util.$ = function(em){
         return $("#" + em)
      };
      util._isArray = function(obj) {
         return Object.prototype.toString.call(obj).toLowerCase() === '[object array]';
      }
      util._isObj = function(obj) {
         return Object.prototype.toString.call(obj).toLowerCase() === '[object object]';
      }
      util._isEmptyObject = function(obj){
           for(var n in obj){
               return false;
           }
           return true;
      }
      util.colorFilter = function(message){
         var exp = /(background|color|background-color)[\s]*?(=|:)[\s]*?[\"|\']?(#?\w+(\([\s]*?\d+,[\s]*?\d+,[\s]*?\d+\))?)[\"|\']?(;)?/gi;
         var m = message.replace(exp,"");
         return m;
      }
      util.filter = function (message) {
         var exp = /<div align="left">&nbsp;<\/div>/gi;
         var m = message.replace(exp,"");
         return m;
      }
     
      util.setFont = function (param) {
         switch(config.keyData.fontSize){
            case "s":param.fontSize = "14px";param.lineHight = "26px";
               break;
            case "m":param.fontSize = "16px";param.lineHight = "28px";
               break;
            case "l":param.fontSize = "20px";param.lineHight = "32px";
               break;
         }
         return param;
      }
      
     util.formatTemplate= function (data, tmpl) {
            return tmpl.replace(/{(\w+)}/g, function (m1, m2) {
                if (!m2)
                    return '';
                return data[m2];
            });
        }
     util.deleteEle =function(arr,id){
				    var om={},newArr=[],im,nm,idlist=[];
				    for( im=0;im<arr.length;im++){
				        nm=arr[im]+typeof(arr[im]);
				        if(typeof(om[nm])==="undefined"){
				            newArr[newArr.length]=arr[im]
				            idlist.push(arr[im]);
				            om[nm]=1;
				        }
				    }
				    return {'newArr':newArr,'idlist':idlist};
			}
        
      
     
   })(view._data,view._util);
   
    (function(d,util,fun){
      var hash = util.getHash();
      var view_data = hash.data; 
      var type = hash.type;
      var status = hash.status;
      var jid = hash.jid;
      var mid = hash.mid; 
      var g_data=[];
      fun.createView = function (items) {
      		//var items = JSON.parse(list); 
            $.extend(g_data, items);
            var tempCon = [], tempKey = [];
            for (key in g_data) {
                if (typeof g_data[key]['key'] == "undefined") g_data[key]['key'] = key;
                tempKey.push(key);
                tempCon.push(g_data[key]); 
            }

            fun.shellSort(tempCon);
            var g_key = Math.max.apply(null, tempKey);//得出最新的key

            var conLength = tempCon.length;

            for (var i = 0; i < conLength; i++) { 
            	var ompType = tempCon[i].type;
            	console.log(ompType);
                if(ompType=='images'){
                	fun.createImages(tempCon[i]); 
                }
                else if(ompType=='coupon'){
               		 fun.createCoupon(tempCon[i]);
                }
                else if(ompType=='text'){
               		 fun.createText(tempCon[i]);
                }
                else if(ompType=='navs'){ 
       	 	   		fun.createNavs(tempCon[i]);
	       	    }
	       	    else if(ompType=='swiper'){ 
	       	 	  		fun.createSwiper(tempCon[i]);
	       	    }
	       	    else if(ompType=='goods'){ 
	       	 	  	fun.createGoods(tempCon[i]);  
	       	    }
	       	    else if(ompType=='notice'){ 
	       	 	 	fun.createNotice(tempCon[i]);       
	       	    }
	       	    else if(ompType=='vedio'){ 
	       	  	  	fun.createVedio(tempCon[i]);        
	       	    }
	       	    else if(ompType=='title'){ 
	       	 	  	fun.createTitle(tempCon[i]);          
	       	    }
	       	    else if(ompType=='tell'){ 
	       	 	     fun.createTell(tempCon[i]);  
	       	    }
	       	    else if(ompType=='blank'){ 
	       	 	  	  fun.createBlank(tempCon[i]);    
	       	    }
	       	    else if(ompType=='comment'){ 
	       	 	  	 fun.createComment(tempCon[i]);        
	       	    }
	       	    else if(ompType=='technician'){ 
	       	 	  	 fun.createTechnician(tempCon[i]);    
	       	    }
	       	    else if(ompType=='serviceItem'){ 
	       	  	   	fun.createServiceItem(tempCon[i]);    
	       	    }
            }
      }
      
      fun.shellSort= function (arr) {
            for (var step = arr.length >> 1; step > 0; step >>= 1) {
                for (var i = 0; i < step; ++i) {
                    for (var j = i + step; j < arr.length; j += step) {
                        var k = j,
							value = arr[j].order,
							tmp = arr[j];
                        while (k >= step && arr[k - step].order > value) {
                            arr[k] = arr[k - step];
                            k -= step;
                        }
                        arr[k] = tmp;
                    }
                }
            }
            return arr;
        },
      
      fun.getPanel =  function (compType) { 
       		if(compType=='images'){
        		return d.tpl.images.join("");      
           }
       	   else if(compType=='coupon'){ 
       	 	  	return d.tpl.coupon.join("");      
       	   }
       	   else if(compType=='text'){ 
       	 	  	return d.tpl.text.join("");      
       	   }
       	   else if(compType=='navs'){ 
       	 	  	return d.tpl.navs.join("");      
       	   }
       	   else if(compType=='swiper'){ 
       	 	  	return d.tpl.swiper.join("");      
       	   }
       	   else if(compType=='goods'){ 
       	 	  	return d.tpl.goods.join("");      
       	   }
       	   else if(compType=='notice'){ 
       	 	  	return d.tpl.notice.join("");      
       	   }
       	   else if(compType=='vedio'){ 
       	 	  	return d.tpl.vedio.join("");      
       	   }
       	   else if(compType=='title'){ 
       	 	  	return d.tpl.title.join("");      
       	   }
       	   else if(compType=='tell'){ 
       	 	  	return d.tpl.tell.join("");      
       	   }
       	   else if(compType=='blank'){ 
       	 	  	return d.tpl.blank.join("");      
       	   }
       	   else if(compType=='comment'){ 
       	 	  	return d.tpl.comment.join("");      
       	   }
       	   else if(compType=='technician'){ 
       	 	  	return d.tpl.technician.join("");      
       	   }
       	   else if(compType=='serviceItem'){ 
       	 	  	return d.tpl.serviceItem.join("");      
       	   }
        },
      /**
         * 图片
         * @param  {Object} list
         */
      fun.createImages = function(con){ 
           var  key = con.key, 
				size = con.prop.size,
				item_list = con.item_list,
				listLng = item_list.length,
				newPanel =  fun.getPanel("images");
		      var element=$(newPanel);
            element.attr("key", key);  
            //老数据样式的调整以及数据的更新
            if (typeof item_list[0].firLink == "undefined") {
                if (size == "0" || size == "1") {
                    size = "0";
                    g_data[key].prop.size = "0";
                }
                if (size == "2") {
                    size = "1";
                    g_data[key].prop.size = "1";
                }
            } 
            //用户选中的样式
             element.find(".STH_images_panel").attr("class", 
             "STH_images_panel STH_images_style_" + size);
 
            for (var d = 0; d < listLng; d++) {
                if (item_list[d]['firLink'] == undefined) { 
                    g_data[key].item_list[d].url = '#kong' + d;
                }
                g_data[key].item_list[d].url = g_data[key].item_list[d].url || '#kong' + d;
                var newobj = {
                    "urldata": g_data[key].item_list[d]["src"],
                    "title": g_data[key].item_list[d]["title"],
                    "url": g_data[key].item_list[d].url
                };
		        	   
                element.find(".STH_images_box .STH_images[rel='yuan']:eq(0)").append("<a href='" + newobj.url + "'><img src='" + newobj.urldata + "' alt='" + newobj.title + "'/></a>");
                element.find(".STH_images_box .STH_images[rel='yuan']:eq(0)").attr("rel", ""); 
   			}
            
  			element.find(".STH_images_box .STH_images").attr("class", "STH_images STH_iDefault_" + size);
            panelImgshow(newPanel, size);  
      }
   	 fun.panelImgshow = function(thisPanel, index) { 
            $(thisPanel).find(".STH_images_box .STH_images").each(function () {
                var nowindex = $(this).index(), htmllen = $(this).html().length;
                $(this).attr("class", "STH_images STH_iDefault_" + index);
                if ((index == 0 || index == 1) && nowindex > 1 && htmllen < 1) {
                    $(this).hide();
                } else if (index == 3 && nowindex > 2 && htmllen < 1) {
                    $(this).hide();
                } else if ((index == 4 || index == 5) && nowindex > 3 && htmllen < 1) {
                    $(this).hide();
                } else if (index == 6 && nowindex > 4 && htmllen < 1) {
                    $(this).hide();
                } else {
                    $(this).show();
                }
            });
           panelImgstyle(thisPanel, index);
        },
     fun.panelImgstyle =  function (thisPanel, index) {
            switch (index) {
                case 0:
                    $(thisPanel).find(".STH_images_box .STH_images").each(function () {
                        var htmllen = $(this).html().length, _this = this;
                        if (htmllen > 0 && $(this).find("img").attr("src") != "") {
                            var newimg = new Image();
                            newimg.src = $(this).find("img").attr("src");
                            newimg.onload = function () {
                                $(_this).height($(_this).find("img").height());
                            }
                        } else {
                            $(_this).height(160);
                        }
                        $(this).css("margin-top", "0px");
                    });
                    break;

                case 1:
                    var h1 = $(thisPanel).find(".STH_images_box .STH_images:eq(0)").width();
                    $(thisPanel).find(".STH_images_box .STH_images").each(function () {
                        $(this).height(h1);
                        $(this).css("margin-top", "0px");
                    });
                    break;

                case 2:
                    var h1 = $(thisPanel).find(".STH_images_box .STH_images:eq(0)").width();
                    $(thisPanel).find(".STH_images_box .STH_images").each(function () {
                        $(this).height(h1);
                        $(this).css("margin-top", "0px");
                    });
                    break;

                case 3:
                    var h1 = $(thisPanel).find(".STH_images_box .STH_images:eq(0)").width();
                    $(thisPanel).find(".STH_images_box .STH_images").each(function () {
                        var index = $(this).index();
                        if (((index + 3) % 3) == 0) {
                            $(this).height(h1 + 4);
                        } else {
                            $(this).height(h1 / 2);
                        }
                        $(this).css("margin-top", "0px");
                    });
                    break;

                case 4:
                    var h1 = $(thisPanel).find(".STH_images_box .STH_images:eq(0)").width();
                    $(thisPanel).find(".STH_images_box .STH_images").each(function () {
                        $(this).height(h1);
                        $(this).css("margin-top", "0px");
                    });
                    break;

                case 5:
                    var h1 = $(thisPanel).find(".STH_images_box .STH_images:eq(0)").width();
                    $(thisPanel).find(".STH_images_box .STH_images").each(function () {
                        var index = $(this).index();
                        if (index == 0 || index == 3 || index == 4) {
                            $(this).height(h1 / 2);
                        } else if (index == 2) {
                            $(this).css("margin-top", (h1 / 2 * (-1)) + "px");
                            $(this).height(h1);
                        } else {
                            $(this).height(h1);
                        }
                    });
                    break;

                case 6:
                    var h1 = $(thisPanel).find(".STH_images_box .STH_images:eq(0)").width();
                    $(thisPanel).find(".STH_images_box .STH_images").each(function () {
                        var index = $(this).index();
                        if (index == 0) {
                            $(this).height(h1);
                        } else {
                            $(this).height(h1);
                        }
                        $(this).css("margin-top", "0px");
                    });
                    break;
            }
        }
      //满减
      fun.createFavorable = function(item){
       
      }
      //优惠券
      fun.createCoupon= function(con){ 
	    	  var  key=con.key, 
	    	       itemlist = con.item_list, 
				   newPanel= fun.getPanel("coupon");   
				      var element=$(newPanel);
				//属性操作 
		        element.attr("key",key); 
		        
				//延时顺序重定位
				var edLength=$(".hb_box .panel-comp").length;
				if($(".hb_box .panel-comp").length<1 || order>parseInt($(".hb_box .panel-comp").eq(edLength-1).attr("order"))){
					$(".hb_box").append(newPanel);
				    	
				}else if(order < parseInt($(".hb_box .panel-comp").eq(0).attr("order"))){
					$(".hb_box").prepend(newPanel);
					 
				}else{
					for(var r=0; r<edLength; r++){
						if(order > parseInt($(".hb_box .panel-comp").eq(r).attr("order")) && order < parseInt($(".hb_box .panel-comp").eq(r+1).attr("order"))){
							$(".hb_box .panel-comp").eq(r).after(newPanel);
							break;
						}	       			
					}
				} 
		        //加入已经有的优惠券
				if(itemlist.length>0){			
					couponIdStr=itemlist.join("|");
					$.ajax({
						type:'post',
						url: '/ShopMain/GetMoreCoupons',
						data: {"couponIdStr":couponIdStr},
						contentType: "application/x-www-form-urlencoded",
						dataType: "json",
						success: function(json) {
							console.log(json);
							if(json.success){
						
								var listmbE=$(newEdit).find(".moban").html(),
									listmbP=element.find(".moban").html(),
									newArray=json.result;
									
								g_data[key].item_list=[];//重置优惠券列表	
									
								for(var g=0;g<newArray.length;g++){
									var newobj=newArray[g];
										newobj["type_name"]=_this.getType_name(coupons_group,newobj["coupon_type"]);										
										
										newobj["pstart_time"]=newobj["start_time"];
										newobj["pend_time"] = newobj["end_time"];
										newobj["start_end_type"] = newobj["start_end_type"];
										newobj["p_style"] = "";
										newobj["start_time"] = newobj["start_time"];
										newobj["end_time"] = newobj["end_time"];
										if (newobj["start_end_type"] == 2) {
										    newobj["start_time"] = "领取时间";
										    newobj["end_time"] = "领取后" + newobj["end_time"]+"后失效";
										}
									
									if(newobj["is_none"]==1){
										newobj["p_style"]="store-card-list-grey";
									} 									
									var newobjP=newobj;
									newobjP.money_exempt=parseInt(newobjP.money_exempt);
									newobjP.money_using=parseInt(newobjP.money_using);
									newobjP.pstart_time=newobjP.pstart_time;
									newobjP.pend_time=newobjP.pend_time;
																				
									//加入显示模板
									if(element.find(".STH_shop_coupon .store-card-list[rel='yuan']").length>0){
										element.find(".STH_shop_coupon .store-card-list[rel='yuan']").remove();
									}
									var newStrP=main.formatTemplate(newobjP,listmbP);
									element.find(".STH_shop_coupon .store-card").append(newStrP);
									
									g_data[key].item_list[g] = newArray[g]['coupon_id'];
									
								} 						
							} 
						},
						error: function(mes) {
							alert("网络不太给力哦！"); 
						}
					});	
				}		        
		        
      }
      /*富文本编译*/
      fun.createText = function(con){
        		var _this=this;
	    	    var key=con.key;
	    	    htmlStr=(con.item_list[0].html.length>=1)?(con.item_list[0].html):"";
	    	    newPanel=fun.getPanel("text");
	            var element=$(newPanel);
		        //属性操作 
		        element.attr("key",key);  
		        element.find(".textareas").html(htmlStr);	 
				
			 	create(newPanel);
      }
      
     
	  /**
	   * 导航栏
	   * @param {Object} list
	   * @param {Object} index
	   */
      fun.createNavs= function(con){
        	var  key=con.key, 
	    	    navStyle = con.prop.navStyle,
	    	    iconStyle = con.prop.iconStyle,
	    	    navLlist = con.prop.navsList,
	    	    listLen = navLlist.length,
	    	    
	    	    newPanel=fun.getPanel("navs");        
	    	    var element=$(newPanel);
	            
		        //属性操作 
		        element.attr("key",key); 
				
				if(navStyle=='style1'){ 
					if(iconStyle!='icon_none'){
						iconStyle = 'icon_top';	
					}
				}else{ 
					if(iconStyle!='icon_none'){
						iconStyle = 'icon_left';
					}
				}
				g_data[key].prop["iconStyle"] = iconStyle;
				//初始化导航样式
				element.find(".STH_navs_panel ul").removeClass("style1 style2 icon_top icon_left icon_none").addClass(navStyle + " " + iconStyle );
			  	var newPanelLi=element.find("#nav_tpl_panel").html();
			 	
			 	//填充之前清空后台和预览容器中的模板内容
			 	element.find(".STH_navs_panel ul").html(''); 
			 	
			 	//导航预览区
			 	for(var i = 0;i < listLen;i++){
			 		var newobj={
			        		"navImg":navLlist[i]["navImg"],
			        		"navImgId": navLlist[i]["navImgId"],
			        		"navText":navLlist[i]["navText"],
			        		"textColor":navLlist[i]["textColor"],
			        		"bgColor":navLlist[i]["bgColor"],
			        		"navUrl":navLlist[i]["navUrl"],
			        		"navUrlName":navLlist[i]["navUrlName"],
							"classifyName":navLlist[i]["classifyName"]
			        },   
		        	nPLi=util.formatTemplate(newobj,newPanelLi); 
	        	    element.find(".STH_navs_panel ul").append(nPLi);  
			 	}
 				
      }
   	   /**
   	    * 轮播图
   	    * @param {Object} list
   	    */
      fun.createSwiper = function(list){
            var key = con.key, 
	    	    autoplay = con.prop.autoplay,
	    	    prop = con.prop,
	    	    item_list = con.item_list,
	    	    listLng = item_list.length,
	    	    newPanel = fun.getPanel("swiper");
			var element=$(newPanel);
            //属性操作 
            element.attr("key", key);  
        
            element.find(".swiper-wrapper").html(""); 
            var newPanelLi = element.find("#imagesmb").html();

            for (var d = 0; d < listLng; d++) {

                var newob = {};
                newob.imgid = item_list[d].imgid;
                newob.urldata = item_list[d].src;
                newob.title = item_list[d].title;
                newob.url = item_list[d].url || "#kong" + d;
                newob.tIndex = d;

                newob.righturlname = item_list[d].righturlname || "";
                newob.all_link = item_list[d].all_link || "";

                g_data[key].item_list[d]['righturlname'] = newob.righturlname; //老数据没有的字段
                g_data[key].item_list[d]['all_link'] = newob.all_link; //老数据没有的字段	
                //if(newob.righturlname==""){
                //	newob.url="#kong"+d;
                //}
                g_data[key].item_list[d].url = newob.url;//如没有老字段则清空

                var nPLi = util.formatTemplate(newob, newPanelLi) ;
                element.find(".swiper-wrapper").append(nPLi); 
            }

         
      }
      /**
       * 商品列表
       * @param {Object} verify
       */
      fun.createGoods = function(con){
      	 /**
      	  * 去掉重复数据函数
      	  */
         
         
           var  key = con.key,
	    	    prop = con.prop,
	    	    order = con.order,
	    	    item_list = con.item_list, 
	    	    showprice = prop.showprice,
	    	    titleshow = prop.titleshow,
	    	    list_name = prop.list_name,
	    	    size = prop.size,
	    	    moreUrl = prop.moreUrl,
	    	    group_id_1 = prop.group_id_1,
	    	    group_id_2 = prop.group_id_2,

 			    newPanel = fun.getPanel("goods");
 			   var element=$(newPanel);
            //左侧panel属性
            element.attr("order", order);
            element.attr("key", key);
            element.find(".goods-list").attr("class", "goods-list style-" + size);
            element.find(".goods-list h3 a h4").html(list_name);
            element.find(".goods-list h3 a").attr("href", moreUrl); 
 

            //商品循环再拉取
            var newPanelLi = element.find(".moban").html(), 
		        idlist =util.deleteEle(item_list,"id").idlist,
		        goodsIdStr = idlist.join("|");

         
        }
     /**
      * 商品图片居中
      * @param {Object} thisPanel
      * @param {Object} thisEdit
      * @param {Object} key
      */
     fun.goodsImgCenter = function (thisPanel, thisEdit, key) {
            $(thisPanel).find(".goods-list.style-small .goods-img, .goods-list.style-big .goods-img").each(function () {
                $(this).height($(this).parents("li").width());
            });
            $(thisPanel).find(".goods-list.style-list .goods-img").each(function () {
                $(this).height(80);
            });
            $(thisPanel).find('.goods-img').imgCenter();
        }
     	
    
      /*菜品列表*/
      fun.createDishes=function(list){
      	
      	
      }
      /*通知*/
      fun.createNotice=function(con){
      	
      	   var  key = con.key,
	    	    prop = con.prop,
	    	    order = con.order,
	    	    newPanel = fun.getPanel("notice");
	    	 var element=$(newPanel);
            /*展示*/ 
            element.attr("key", key); 
            element.find('.notice-box').html(prop.noticeValue); 
             
             console.log(key+","+prop.noticeValue);
 			 $(_this).append(element);
      }
      
      fun.createVedio=function(con){ 
			var key=con.key,
	    	    order = con.order,
				prop=con.prop,
				vediohtml=prop.vediohtml,
				vediosrc=prop.vediosrc,
			
				newPanel=fun.getPanel("vedio");  
			 var element=$(newPanel);
			//属性操作
	        element.attr("order",order);
	        element.attr("key",key); 
		        
			if(vediohtml!="" && vediosrc!=""){
				element.find(".STH_vedio_box iframe").show();
				element.find(".STH_vedio_box div").hide();
	        	element.find(".STH_vedio_box iframe").attr("src",vediosrc); 
			}
			 $(_this).append(element);
      }
      
      fun.createTitle=function(title){
      	
      		var  key=con.key, 
				prop=con.prop,
			
				newPanel=fun.getPanel("title");    
				 var element=$(newPanel);
			//panel属性	        
	        element.attr("key",key);	
		    element.attr("order",order);		
			element.find("span").html(prop.titleVal);
			if(prop.logoId!="default")element.find("img").attr("src",prop.logoUrl);
			element.find("label").html(prop.rightVal);
			if(prop.rightVal==""){
				element.find("i").hide();
				element.find("a").attr("href","javascript:void(0)");
				g_data[key].prop.all_link="";g_data[key].prop.righturl="";g_data[key].prop.righturlname="";
			}else{
				element.find("i").show();
				element.find("a").attr("href",prop.righturl);
			}
	       $(_this).append(element);
	   
      }
      
      fun.createTell = function(con){
      	
      		    key=con.key,
	    	    order = con.order,
				prop=con.prop,
			
				newPanel=fun.getPanel("tell");  
				 var element=$(newPanel);
			
			//属性操作
	        element.attr("order",order);
	        element.attr("key",key); 
		        
			element.find("label").text(prop.tellNum);  
			  $(_this).append(element);
      }
      
      fun.createBlank=function(con){
      	var     key=con.key,
	    	    order = con.order,
	    	    param=con.param,
	    	    blankValue=con.prop.blankValue,
	    	    blankColor=con.prop.blankColor, 
	    	    newPanel=fun.getPanel("blank");
	    	    var element=$(newPanel);
	            
		        //属性操作
		        element.attr("order",order);
		        element.attr("key",key);
		        element.find(".blank-box-p").height(blankValue);
		        element.find(".blank-box-p").css('backgroundColor', blankColor );
		          $(_this).append(element);
		     
      }
      fun.createComment=function(con){
      			var  key=con.key,
	    	    order = con.order,
				prop=con.prop,
				title = prop.title,
				type = prop.type,
				num = prop.num,
				g_stars  = {
		        	"1":'one',
		        	"2":'two',
		        	"3":'three',
		        	"4":'four',
		        	"5":'five'
		        },
				newPanel=fun.getPanel("comment"); 
			 var element=$(newPanel);
	        //属性操作 
	       
	        element.attr("order",order);
	        element.attr("key",key); 
	        element.find(".STH_comment_title h2").html(title);  


		    $.ajax({
		    	type: 'post',
		    	url: '/ShopMain/GetComment',
				data: {
					"type":type,
					"num":num
				},
				contentType: "application/x-www-form-urlencoded",
				dataType: "json",
				success:function(json){
					//console.log(json);
					if(json.success){
							var newPanelLi = element.find("#comment_moban").html();
						var newPanelPic=element.find("#comment_imglist").html(),
							newArray=json.result,
							newArrayLen = newArray.length;
						var html =  element.find(".STH_comment_list .comment_con[rel='yuan']").prop("outerHTML");
						if(newArrayLen>0){
							element.find(".STH_comment_list").html("");
							for(var d=0;d<newArrayLen;d++){
								var content = newArray[d]['label_value']?newArray[d]['label_value']:"";
								var newobj={
						    		"user_name":newArray[d]['user_name'],
						    		"star_level": newArray[d]['star_level'],
						    		"header_img":newArray[d]['header_img'],
						    		'content':content + newArray[d]['content'],
						    		'create_time':newArray[d]['create_time'],
						    		'is_good':newArray[d]['is_good']?newArray[d]['is_good']:"",
							    	'label':newArray[d]['foods_attr_values']?newArray[d]['foods_attr_values']:""	
						    	},	
					        	nPLi=main.formatTemplate(newobj,newPanelLi);
								element.find(".STH_comment_list").append(nPLi);
								if(newArray[d]['response']!=""){
					        		var strResponse = '<div class="store">'+
													'商家回复:"'+newArray[d]['response']+'"'+
													'</div>';
									element.find('.comment_con').eq(d).find('.comment_img_box').after(strResponse);
								}

								if(newobj.content!=""){
									if(sellerVersion==5){
										var strWord = '<p class="word word_repasts"><i></i>'+newobj.content+'</p>';		
									}else{
										var strWord = '<p class="word">'+newobj.content+'</p>';	
									}		
									element.find('.comment_con').eq(d).find('.comment_img_box').before(strWord);
								}
								if(sellerVersion==5){
									if(newobj.is_good!="" || newobj.label!=""){
										var htmlFavorInner = "",
											htmlFavorOuter='<div class="comment_favor clearfix">';
										if(newobj.is_good!=""){
											var class_name = newobj.is_good==1?"ic_favor_up":"ic_favor_down";
												htmlFavorInner += "<i class='ic_favor fl "+class_name+"'></i>";
										}
										if(newobj.label!=""){
											var str="<div class='comment_favor_tag fl'>",
												len = newobj.label.length;
											for(var i =0;i<len;i++){
												str+='<span>'+newobj.label[i]+'</span>';
											}
											str+='</div>';
											htmlFavorInner+=str;
										}
										htmlFavorOuter+=htmlFavorInner+'</div>';

										element.find('.comment_con').eq(d).find('.title').after(htmlFavorOuter);
									}
								}
					        	var str = '',picArrLen = newArray[d].pic_arr.length;
					        	if(picArrLen>0){
					        		for(var i =0;i<picArrLen;i++){
						        		var newpic = {
						        			"pic":newArray[d]['pic_arr'][i]
						        		},
						        		nPic = main.formatTemplate(newpic,newPanelPic);	
						        		str+=nPic;
					        		}	
					        		element.find('.comment_con').eq(d).find(".comment_img_box").html(str);
					        	}
					        	var class_name = g_stars[newArray[d]['star_level']],
					        		class_star = 'stars '+class_name+'';
					        	element.find('.comment_con').eq(d).find(".stars").attr('class',class_star);
							}
						}else{
							element.find(".STH_comment_list").html(html);
						}
						element.find('.STH_comment_list .evaluate_img').imgCenter();
 						 $(_this).append(element);
					}else{
						console.log(json.msg);
					}
				},
				error: function(mes) {
					alert("网络不太给力哦！");
					console.log("远程请求获取优惠券详情失败，请联络管理员。");
				}
		    }) 
      	
      }
      
      
    	
      //技能师
      fun.createTechnician=function(list){
      	Array.prototype.deleteEle=function(id){
				    var arr=this,om={},newArr=[],im,nm,idlist=[];
				    for( im=0;im<arr.length;im++){
				        nm=arr[im]+typeof(arr[im]);
				        if(typeof(om[nm])==="undefined"){
				            newArr[newArr.length]=arr[im]
				            idlist.push(arr[im]);
				            om[nm]=1;
				        }
				    }
				    return {'newArr':newArr,'idlist':idlist};
			}
      		var    key=con.key,
	    	    prop=con.prop,
	    	    order = con.order,
	    	    item_list=con.item_list,
	    	    level_name=prop.level_name,
	    	    size=prop.size,
	    	    level_id=prop.level_id,
	    	    
	    	    newPanel=fun.getPanel("technician");  
			 var element=$(newPanel);
	 	 
			
			
			//左侧panel属性
			element.attr("order",order);
		    element.attr("key",key);
		    element.find(".tech-list").attr("class","tech-list style-"+size);
		    
	  


			//人员循环再拉取
			var newPanelLi=element.find(".moban").html(), 
		        idlist=item_list.deleteEle("id").idlist,
		        technicianIdStr=idlist.join("|");
			
				$.ajax({
					type: 'post',
					url: '/ShopMain/GetServiceUsersDetail',
					data: {"technicianIdStr":technicianIdStr},
					contentType: "application/x-www-form-urlencoded",
					dataType: "json",
					success: function(json) {
						// console.log(json);
						if(json.success){
							var item_list=json.data,
							    listLng=item_list.length;
							console.log(item_list);    
							g_data[key].item_list=[];//重置列表
							
							if(listLng>0){
								$(newEdit).find(".tech-list-show ul").html("");
								element.find(".tech-list ul").html("");
						        for(var d=0;d<listLng;d++){
									    	
									    var newobj={
									    		"id":item_list[d]['id'],
									    		"photo_url":item_list[d]['photo_url'],
									    		"nickname": item_list[d]['name'],
									    		"level":item_list[d]['level'],
									    		"sale":item_list[d]['sale']
									    	},

							        		nPLi=util.formatTemplate(newobj,newPanelLi);
							        	    
							        	element.find(".tech-list ul").append(nPLi); 
							        	g_data[key].item_list[d]=item_list[d]['id'];
							        	
							        	//图片居中
							        	goodsImgCenter(newPanel,newEdit,key);
						        	//}
		                            $(_this).append(element);
						        }
							}
						}else{
							alert(json.msg);
						}
					},
					error: function(mes) {
						alert("网络不太给力哦！");
						console.log("远程请求获取服务人员详情失败，请联络管理员。");
					}
				});
      	
      }
      
     fun.getGroupIndex=function (obj,id){
			var index=0;
			for(var i=0;i<obj.length;i++){
					if(id==obj[i].group_id){
						index=i;
						break;
					}	
			}
			return index;
		}
     
      /*服务列表*/
      fun.createServiceItem=function(list){ 
	    	var  
	    	    key=con.key,
	    	    prop=con.prop,
	    	    order = con.order,
	    	    item_list=con.item_list,
	    	    cate_name=prop.cate_name,
	    	    size=prop.size,
	    	    cate_id=prop.cate_id,
	    	    newPanel=fun.getPanel("serviceItem");
		 
			
			//左侧panel属性
			element.attr("order",order);
		    element.attr("key",key);
		    element.find(".serviceItem-list").attr("class","serviceItem-list style-"+size);
		    
		   
			    
			//插入edit
	        $(".edit-panel").append(newEdit);


			//服务循环再拉取
			var newPanelLi=element.find(".moban").html(), 
		        idlist=item_list.deleteEle("id").idlist,
		        serviceIdStr=idlist.join("|");
			
				$.ajax({
					type: 'post',
					url: '/ShopMain/GetServicesDetail',
					data: {"serviceIdStr":serviceIdStr},
					contentType: "application/x-www-form-urlencoded",
					dataType: "json",
					success: function(json) { 
					    if (json.success) {
							var item_list=json.data,
							    listLng=item_list.length;   
							g_data[key].item_list=[];//重置服务列表
							
							if(listLng>0){ 
								element.find(".serviceItem-list ul").html("");
						        for(var d=0;d<listLng;d++){
									    var newobj={
									    		"id":item_list[d]['id'],
									    		"name":item_list[d]['name'],
									    		"present_price":item_list[d]['present_price'],
									    		"original_price":item_list[d]['original_price'],
									    		'pic_url':item_list[d]['pic_id'],
									    		"sale":item_list[d]['sale'],
									    		'is_rates':item_list[d]['is_rates']
									    	},	
							        		nPLi=main.formatTemplate(newobj,newPanelLi);
							        	    element.find(".serviceItem-list ul").append(nPLi);
							    			element.find(".serviceItem-list ul li").eq(d).find(".serviceItem-price").html("￥"+newobj.present_price);
											element.find(".serviceItem-list ul li").eq(d).find("del").html("￥"+newobj.original_price);
							         	    g_data[key].item_list[d]=item_list[d]['id']; 
							      		    serviceItemImgCenter(newPanel,newEdit,key); 
							      		     $(_this).append(element);
						        }
					        }
					        
					 						
							
						}else{
							alert(json.msg);
						}
					},
					error: function(mes) {
						alert("网络不太给力哦！");
						console.log("远程请求获取服务详情失败，请联络管理员。");
					}
				});
      	
      }
      /**
         * 加载成功
         * 
         */
      fun.loadOk = function(){  
          fun.createView(view_data); 
      }
    
	/**
	 * 创建数量
	 * @param {Object} h
	 * @param {Object} method
	 */
      fun.create = function(h,method){ 
         var o = $(_this);
         console.log(h); 
         console.log("method="+method);
         switch(method){
            case "1" :
               o.append(h);
               break;
            case "2" :
               o.prepend(h);
               break;
            case "3" :
               o.html(h);
               break;
            case "4" :
               return h;
         }
             
      }  
      fun.init = function(){  
         if(status == "1"){
            if (view_data !==null && view_data!==undefined){         
               fun.loadOk(); 
            } 
         } 
       
      }
      fun.init();

   })(view._data,view._util,view._fun)
}
